var portal;
var CUR_TASK_WINDOW;
var CUR_TASK_DATAGRID
$(function(){
	portal = $('#portal').portal({
		border : false,
		//fit: true
	});

	
	CUR_TASK_WINDOW = GETID('abwWindow');
	
	BS_WINDOW_INIT(CUR_TASK_WINDOW, 800, 600);
	//alert(CUR_TASK_WINDOW);
	CUR_TASK_DATAGRID = GETID('affairsBeDealtWithDataGridFull');
	var URL = 'workflowTasksAjax!loadCurUserTasksData';
	var COLUMNS = [{field:'processName',title:'流程名称',width:200}, 
	               {field:'taskName',title:'任务名称',width:200},
	               {field:'assigne',title:'执行人',width:80},
	               {field:'createTime',title:'创建时间',width:150}];
	
	//初始化数据表
	DG_WF_INIT(CUR_TASK_DATAGRID, URL, COLUMNS, true, true);
	//初始化分页
	DG_PAGE_INIT(CUR_TASK_DATAGRID, URL, null);
	
	var p = $('<div/>').appendTo('body').panel({
		title:'待办事宜',
		href:'main!affairsBeDealtWith',
		height:300,
		tools:[{
		       	iconCls:'icon-add',
		       	handler:function(){
		       		BS_WINDOW_OPEN(CUR_TASK_WINDOW, '待办事宜', 'task');
		       	} 
		}]
	});
	
	portal.portal('add', {
		panel : p,
		columnIndex : 0
	});

	var p = $('<div/>').appendTo('body').panel({
		title : '系统公告',
		href: 'main!notices',
		height : 300,
	});
	
	portal.portal('add', {
		panel : p,
		columnIndex : 1
	});
	
	var p = $('<div/>').appendTo('body').panel({
		title : '未读邮件',
		href: 'main!about',
		height : 300,
	});
	
	portal.portal('add', {
		panel : p,
		columnIndex : 0
	});
	
	portal.portal('resize');
});